package com.qfmy.web.app.controller.novel;

import com.qfmy.common.result.Result;
import com.qfmy.web.app.service.novel.NovelCommentLikeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 清风明月
 * @Package com.qfmy.web.app.controller.novel
 * @date 2025/10/31
 * @description 评论点赞表
 */
@RestController
@RequestMapping("/app/commentLike")
public class NovelCommentLikeController {

    /**
     * 注入service
     */
    @Autowired
    private NovelCommentLikeService novelCommentLikeService;

    /**
     * 进行点赞
     */
    @RequestMapping("/addCommentLike")
    public Result<String> addCommentLike(@RequestParam Integer commentId) {
        novelCommentLikeService.addCommentLike(commentId);
        return Result.ok();
    }

    /**
     * 取消点赞
     */
    @RequestMapping("/cancelCommentLike")
    public Result<String> cancelCommentLike(@RequestParam Integer commentId) {
        novelCommentLikeService.cancelCommentLike(commentId);
        return Result.ok();
    }


}
